/*
	Interface对象的write方法
	将违建内容输出在控制台中
*/
var readline = require('readline');
var fs = require('fs');
var file = fs.createReadStream('./message.txt');
var r1 = readline.createInterface({
	input: file,
	output: process.stdout,
	terminal: true
});

file.on('end', function() {
	var buf = new Buffer('文件读取时间：' + (new Date()).toLocaleString());
	r1.write('\r\n');
	
	// r1.write(buf);

	// 使用key参数值模拟Ctrl+u组合键按下以取消控制台中系统时间的输出
	r1.write(buf, {ctrl:true, name:'u'});
})